package com.fortune.service.impl;

import com.fortune.dao.PaymentMethodDao;
import com.fortune.dto.in.paymentMethod.PaymentMethodAddDto;
import com.fortune.dto.in.paymentMethod.PaymentMethodEditDto;
import com.fortune.dto.in.paymentMethod.PaymentMethodListDto;
import com.fortune.service.PaymentMethodService;
import com.fortune.vo.paymentMethod.PaymentMethod;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PaymentMethodServiceImpl implements PaymentMethodService {
    @Autowired
    private PaymentMethodDao paymentMethodDao;

    /**
     * 查询付款方式
     * @param companyId
     * @return
     */
    @Override
    public List<PaymentMethod> queryPaymentMethod(String companyId,PaymentMethodListDto paymentMethodListDto) {
        return paymentMethodDao.queryPaymentMethod(companyId,paymentMethodListDto);
    }

    /**
     * 查询付款方式个数
     * @param companyId
     * @param paymentMethodListDto
     * @return
     */
    @Override
    public int queryPaymentMethodCount(String companyId, PaymentMethodListDto paymentMethodListDto) {
        return paymentMethodDao.queryPaymentMethodCount(companyId,paymentMethodListDto);
    }

    /**
     * 添加付款方式
     * @param companyId
     * @param paymentMethodAddDto
     * @return
     */
    @Override
    public int addPaymentMethod(String companyId, PaymentMethodAddDto paymentMethodAddDto) {
        return paymentMethodDao.addPaymentMethod(companyId,paymentMethodAddDto);
    }

    /**
     * 编辑付款方式
     * @param companyId
     * @param paymentMethodEditDto
     * @return
     */
    @Override
    public int editPaymentMethod(String companyId, PaymentMethodEditDto paymentMethodEditDto) {
        return paymentMethodDao.editPaymentMethod(companyId,paymentMethodEditDto);
    }

    /**
     * 删除付款方式
     * @param companyId
     * @param paymentMethodId
     * @return
     */
    @Override
    public int deletePaymentMethod(String companyId, String paymentMethodId) {
        return paymentMethodDao.deletePaymentMethod(companyId,paymentMethodId);
    }

    /**
     * 添加时验重
     * @param companyId
     * @param paymentMethodAddDto
     * @return
     */
    @Override
    public int queryAddPaymentMethod(String companyId, PaymentMethodAddDto paymentMethodAddDto) {
        return paymentMethodDao.queryAddPaymentMethod(companyId,paymentMethodAddDto);
    }

    /**
     *编辑时验重
     * @param companyId
     * @param paymentMethodEditDto
     * @return
     */
    @Override
    public int queryEditPaymentMethod(String companyId, PaymentMethodEditDto paymentMethodEditDto) {
        return paymentMethodDao.queryEditPaymentMethod(companyId,paymentMethodEditDto);
    }
}
